package com.tdkj.model.shop;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;
import com.tdkj.model.user.BeanUser;

@Entity
@Table(name = "shop_evaluate")
public class BeanEvaluate extends BaseEntity  {

	private BeanEvaluateType type;
	private String content;
	private BeanUser user;
	private BeanUser toUser;
	private Timestamp dateTime;
	
	//0,1，买家,卖家
	private Integer flag;

	@ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.REFRESH})
	@JoinColumn(name="type_id")
	public BeanEvaluateType getType() {
		return type;
	}

	public void setType(BeanEvaluateType type) {
		this.type = type;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.REFRESH})
	@JoinColumn(name="user_id")
	public BeanUser getUser() {
		return user;
	}

	public void setUser(BeanUser user) {
		this.user = user;
	}

	@ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.REFRESH})
	@JoinColumn(name="to_user_id")
	public BeanUser getToUser() {
		return toUser;
	}

	public void setToUser(BeanUser toUser) {
		this.toUser = toUser;
	}

	public Timestamp getDateTime() {
		return dateTime;
	}

	public void setDateTime(Timestamp dateTime) {
		this.dateTime = dateTime;
	}

	public Integer getFlag() {
		return flag;
	}

	public void setFlag(Integer flag) {
		this.flag = flag;
	}
	
}